package cbbx_sm.decision_maker;

import java.util.List;

import cbbx_sm.probabilistic_model.Cluster;

/**
 * A decision is the description of the next step or cycle of
 * data collection. So it is a list of sensors (only camera for now)
 * from which collecting data along with their configuration (only
 * cluster to zoom-in for now).
 * We can insert Decision for multiple future timestamps, etc...
 * 
 * @author Alessio Della Motta - University of California, Irvine
 *
 */
public class Decision {
	private List<CameraConfiguration> cameraConfigurations;
	
	public Decision(List<CameraConfiguration> cameraConfigurations){
		this.cameraConfigurations = cameraConfigurations;
	}
	
	public boolean cameraZoomedIn(String cameraId){
		for (CameraConfiguration conf : cameraConfigurations)
			if (conf.getCameraId().equals(cameraId)/* && conf.getCluster() != null*/)
				return true;
		
		return false;
	}

	public Cluster clusterChosenInCamera(String cameraId){
		for (CameraConfiguration conf : cameraConfigurations)
			if (conf.getCameraId().equals(cameraId) /*&& conf.getCluster() != null*/)
				return conf.getCluster();
		
		return null;
	}
	
	public List<CameraConfiguration> getDecision() {
		return cameraConfigurations;
	}

	public void setDecision(List<CameraConfiguration> cameraConfigurations) {
		this.cameraConfigurations = cameraConfigurations;
	}

	@Override
	public String toString() {
		return "Decision [cameraConfigurations=" + cameraConfigurations + "]";
	}
	
	
}
